package chapter11;import java.util.concurrent.BlockingQueue;import java.util.concurrent.LinkedTransferQueue;/** * 总消息队列管理 * * @author tengfei.fangtf */public class MsgQueueManager implements IMsgQueue {    /**     * 消息总队列     */    public final BlockingQueue<Message> messageQueue;    private MsgQueueManager() {        messageQueue = new LinkedTransferQueue<Message>();    }    public void put(Message msg) {        try {            messageQueue.put(msg);        } catch (InterruptedException e) {            Thread.currentThread().interrupt();        }    }    public Message take() {        try {            return messageQueue.take();        } catch (InterruptedException e) {            Thread.currentThread().interrupt();        }        return null;    }}